﻿ using System;
using System.Data;
using System.Windows;
using System.Windows.Data;
using System.ComponentModel;
using System.Windows.Controls;
namespace WPFExcelReport.Controls
{
    public partial class TBUSY : UserControl
    {
        #region ==IsBusy===========
        public static readonly DependencyProperty IsBusyProperty = DependencyProperty.Register("IsBusy",
            typeof(bool), typeof(TBUSY),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsBusyChanged));
        public bool IsBusy
        {
            get
            {
                return (bool)GetValue(IsBusyProperty);
            }
            set
            {
                SetValue(IsBusyProperty, value); 
            }
        }
        private static void OnIsBusyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as TBUSY;
            if (src != null)
            {
                src.IsBusy = (bool)e.NewValue;
            }
        }
        #endregion
        public TBUSY()
        {
            InitializeComponent();  
        }  
    }
}
